<extend name="_layout/main" />
<block name="head">
    <style>
        .bootbox-body img {
            max-width: 100%!important;
        }
    </style>

</block>
<block name="content">
    <div class="page-content">
        <div class="page-breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="{:U('dashboard/index')}">系统首页</a>
                </li>
                <li>
                    <a href="javascript:;">用户管理</a>
                </li>
                <li class="active">会员激活记录</li>
            </ul>
        </div>

        <div class="page-body">
            <div class="row">
                <div class="col-lg-12 col-sm-12 col-xs-12">
                    <div class="widget">
                        <div class="widget-header bordered-left bordered-darkorange">
                            <span class="widget-caption">会员激活记录</span>
                            <div class="widget-buttons">

                                <a href="#" data-toggle="collapse">
                                    <i class="fa fa-minus"></i>
                                </a>
                                <a href="#" data-toggle="dispose">
                                    <i class="fa fa-times"></i>
                                </a>
                            </div>
                        </div>
                        <div class="widget-body bordered-left bordered-warning">
                            <form class="form-inline" role="form">
                                <input type="hidden" value="{:I('catid')}" name="catid" />
                                <div class="form-group">
                                    <input type="text" class="form-control" name="keyword" placeholder="ID" value="{$Think.request.keyword}">
                                </div>

                                <button type="submit" class="btn btn-default">搜索</button>


                            </form>

                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12 col-md-12">
                    <form method="post" id="listForm">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th class="text-center">用户</th>
                                <th class="text-center">运营中心</th>
                                <th class="text-center">金额</th>
                                <th class="text-center">支付方式</th>
                                <th class="text-center">提交时间</th>
                                <th class="text-center">审核时间</th>
                                <th class="text-center">状态</th>
                                <th class="text-center" width="250">操作</th>
                            </tr>
                            </thead>
                            <volist name="result" id="val">
                                <tr>

                                    <td class="text-center"><a href="{:U('detail',['id'=>$val['user_id']])}">{$users[$val['user_id']]['nickname']}</a></td>
                                    <td class="text-center input-group-xs" style="width: 80px;">
                                        <a href="{:U('detail',['id'=>$val['apply_id']])}">{$users[$val['apply_id']]['nickname']}</a>
                                    </td>
                                    <td class="text-center">{$val.amount}</td>
                                    <td class="text-center">{:payTypes($val['pay_type'])}</td>
                                    <td class="text-center">{$val.created_at|format_time}</td>
                                    <td class="text-center">{$val.deal_at|format_time}</td>
                                    <td class="text-center">{:applyStatus($val['status'])}</td>
                                    <td class="text-center">
                                        <eq name="val['status']" value="0">
                                        <a href="{:U('User/active_success',['id'=>$val['id']])}" class="btn btn-default btn-xs" data-confirm="<b>确定通过审核吗?</b><br /><br /> 系统将从运营中心【{$users[$val['apply_id']]['nickname']}】扣除{:payTypes($val['pay_type'])}"><i class="fa  fa-edit"></i>确认通过</a>
                                        <a href="{:U('User/active_fail',['id'=>$val['id']])}" class="btn btn-default btn-xs ajax-load"><i class="fa  fa-edit"></i>拒绝</a>
                                        </eq>
                                        <eq name="val['status']" value="1">
                                        <a href="{:U('User/active_delete',['id'=>$val['id']])}" class="btn btn-danger btn-xs white" data-confirm="确定删除该记录?"><i class="fa fa-trash-o"></i>删除</a>
                                        </eq>
                                    </td>

                                </tr>
                            </volist>
                            <tbody>
                            </tbody>
                        </table>
                        <div class="row DTTTFooter">
                            <div class="col-sm-6">
                                <div class="dataTables_info" id="simpledatatable_info" role="status" aria-live="polite">
                                    <div class="buttons-preview"></div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="dataTables_paginate paging_bootstrap" id="simpledatatable_paginate">
                                    {$page}
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
</block>

<block name="footer">
    <script src="/Public/assets/js/jquery.form.js" type="text/javascript" charset="utf-8"></script>

    <script type="text/javascript">
        function checkCount() {
            return $(".select-item:checked").length;
        }
        $("#sort,#delete,#move a").click(function() {
            var action = $(this).data("action");
            if(!action) return false;
            if (!checkCount()) {
                tips('请选择要操作的数据', 'danger');
                return false;
            }
            var confirmText = $(this).data("confirmtext");
            if(confirmText){
                bootbox.confirm(confirmText,function(flag){
                    if(flag){
                        $("#listForm").attr("action",action).ajaxSubmit(function(result) {
                            result = JSON.parse(result);
                            if (result.status == 'success') {
                                location.reload();
                            } else {
                                tips(result.message, 'danger');
                            }
                        });
                    }
                })
            }else{
                $("#listForm").attr("action",action).ajaxSubmit(function(result) {
                    result = JSON.parse(result);
                    if (result.status == 'success') {
                        location.reload();
                    } else {
                        tips(result.message, 'danger');
                    }
                });
            }

        });
    </script>

</block>